<?php

/**
 * @author Thibaut Cromphaut, Gaïtano Boeraeve, Mathias Helin, Dimitry Dierickx
 * @copyright  Copyright (c) 2011 Artevelde University College Ghent 
 */

class Application_Form_Element_UserSelect extends Zend_Form_Element_Select {
    public function init() {
        $user = new Application_Model_User();
        $this->addMultiOption(0, 'Kies ...');        
        $this->setLabel('User:');
        $userMapper = new Application_Model_UserMapper();
      
        foreach ($userMapper->fetchAll() as $user) {
            $this->addMultiOption($user->getId(), $user->getDisplayname());
        }
    }
}